package bbcom.interfaces;

import bbcom.PropertiesType;

import java.io.IOException;
import java.util.List;

/**
 * Created by Thanh-Trung Pham.
 */
public interface IDeployer {

    void setConfigurationSettings(String baseFolderName);

    void setPlugins(IPropertiesParser propertiesParserPlugin);

    /**
     * Deploy the given BBCoMInstance file to the given host with its properties.
     *
     * @param properties            the properties of the given host.
     * @param BBCoMInstanceFilename the filename of a BBCoMInstance.
     * @throws IOException if there is an error.
     */
    void deployBBCoMInstanceFile(PropertiesType properties, String BBCoMInstanceFilename) throws IOException;

    /**
     * Deploy the given list of dependency files to the given host with its properties.
     *
     * @param properties          the properties of the given host.
     * @param dependencyFilenames the given list of dependency file names (folders' names containing *.jar, *.class).
     * @throws IOException if there is an error.
     */
    void deployDependencyFiles(PropertiesType properties, List<String> dependencyFilenames) throws IOException;

    /**
     * Get the start Java command on the given device container with its properties.
     *
     * @param properties        the properties of the given device container.
     * @param isDebuggingEnable Is the debugging enable?
     * @param commandArgs       the additional command arguments.
     */
    String getStartJava(PropertiesType properties, String commandArgs, boolean isDebuggingEnable);


    /**
     * Stop the Java on the given device container with its properties.
     *
     * @param properties  the properties of the given device container.
     * @param commandArgs the additional command arguments.
     */
    void stopJava(PropertiesType properties, String commandArgs);

}
